<template>
  <div>
    <el-page-header @back="goBack" >
    </el-page-header>
    <br>
    <el-container>
      <el-header height='50px' style="text-align:left">
        <div style="color: #20a0ff;text-align:left;height: 25px">更多高校</div>
      </el-header>
      <el-main >
      </el-main>
    </el-container>
    <el-container>
      <el-row style="width: 100%;margin-left: 30px">
        <el-col :span="6" v-for="(item) in keyUniversity" :key="item.classId" :offset="0" >
          <el-card class="box-card">
            <div slot="header" class="clearfix" style="line-height: 40px">
              <span>{{item["name"]}}</span>
            </div>
            <div style="height: 30px;">
              <span>地区：  {{item["provinve"]}}省 {{item["city"]}}市</span>
            </div>
            <div style="height: 30px">
              <span>活跃人数:&nbsp&nbsp</span>
              <span style="color: #20a0ff">{{item["activePeople"]}}万(活跃) / </span>
              <span>{{item["basePeople"]}}万(基数)</span>
            </div>
            <div style="height: 30px">
              <span>负责人：  {{item["director"]}}</span>
            </div>
            <div style="height: 30px">
              <span>评测：  {{item["evaNum"]}}人次</span>
            </div>
<!--            <div style="height: 25px">-->
<!--              <span>好评率：{{item["praise"]}}%</span>-->
<!--            </div>-->
<!--            <div style="height: 25px">-->
<!--              <i class="fa fa-star-o"></i>-->
<!--              <span >{{item["star"]}}</span>-->
<!--            </div>-->
            <div style="height: 30px">
              <el-link style="color: #20a0ff" @click="click1(item.name)">查看详情</el-link>
            </div>
          </el-card>
        </el-col>
      </el-row>

    </el-container>
    <el-container style="margin-left: 300px">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change=
          "handleCurrentChange"
        :current-page="queryInfo.pagenum"
        :page-sizes="[4, 8]"
        :page-size="queryInfo.pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </el-container>
  </div>
</template>

<script>
    export default {
        name: "allSchool",
        data() {
            return {
                keyUniversity:{},//重点高校
                queryInfo: {
                    // 当前页数
                    pageNum: 1,
                    pageSize: 4
                },
                total: 0,
            };
        },
        created() {
            this.initData();
        },
        methods: {
            initData() {
                var allData
                this.$axios.post("managementSystem/university/moreUniversity",this.queryInfo)
                    .then(data => {
                        if (data.status != 200) {
                            this.$message.error('服务出错' + data.status);
                            // this.$message(fgf{
                            //   message:'服务错误',
                            //   type:'warn'
                            // });
                        } else {
                            if (data.data.errorCode == '200') {
                                allData = data.data
                                console.log(allData.errorMsg)

                                //keyUniversity部分初始化
                                this.keyUniversity=allData.keyUniversity
                                // this.keyUniversity=[{"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8},
                                //     {"province":"湖北","city":"武汉","name":"华中科技大学","activePeople":2,"basePeople":4,"director":"李元元","evaNum":100,"praise":98,"star":4.8}]
                                this.total = allData.totalNum
                            }
                        }
                    })
            },
            // 监听pagesize改变的事件
            handleSizeChange (newSize) {
                this.queryInfo.pageSize = newSize
                this.initData()
            },
            // 监听 页码值 改变的事件
            handleCurrentChange (newPage) {
                // console.log(newPage)
                this.queryInfo.pageNum = newPage
                this.initData()
            },
            click1(val){
                console.log("要跳转的学校名字:"+val)
                this.$router.push({path:"/home/schoolOperationData",query:{universityName:val}});
            },
            goBack(){
                this.$router.go(-1);
            }
        }
    }
</script>

<style scoped>

</style>
